<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript" src="${ctx}/js/jquery.itextclear.js"></script>
<script type="text/javascript" src="${ctx}/js/Tree.js"></script>
<script type="text/javascript" src="${ctx}/js/employee.js"></script>
<script type="text/javascript" src="${ctx}/js/global_util.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $('input[type=text], input[type=password], input[type=url], input[type=email], input[type=number], textarea', '.form').iTextClear();
    });
</script>
<!-- jQplot CSS -->

<link rel="stylesheet" media="screen" href="${ctx}/css/Tree.css"/>
<!-- jQplot CSS END -->

<!-- DATATABLES CSS -->
<link rel="stylesheet" media="screen" href="${ctx}/lib/datatables/css/vpad.css"/>
<script type="text/javascript" src="${ctx}/lib/datatables/js/jquery.dataTables.js"></script>

<!-- DATATABLES CSS END -->

<script>
    $(document).ready(function() {
        $('#simple-button').popover('#simple-popover', {});
        $('#top-button').popover('#top-popover', {preventLeft: true, preventRight: true, preventBottom:true});
    });
</script>

<h1 class="page-title">员工资料管理</h1>

<table class="display" id="example">
    <thead>
    <tr>
        <th>选择</th>
        <th>员工工号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>出生日期</th>
        <th>身份证号码</th>
        <th>部门</th>
        <th>职务</th>
        <th>职等</th>
        <th>户籍</th>
        <th>档案所在地</th>
    </tr>
    </thead>
    <tbody>

    <s:iterator value="employeeinfoWorks" var="reg" status="sta">
        <s:if test="#sta.odd">
            <tr class="gradeX">
        </s:if>
        <s:else>
            <tr class="gradeC">
        </s:else>
        <td><input type="radio" name="select_staff" value="${reg.baseId.id}_${reg.baseId.name}" onclick="selectStaff(this)"/>
        </td>
        <td><a href="#employee/staff_view.xhtml?id=${reg.id}">${reg.workNo}</a></td>
        <td>${reg.baseId.name}</td>
        <td>${reg.baseId.sex=="0"?"男":"女"}</td>
        <td><s:date name="#reg.baseId.birthday" format="yyyy/MM/dd"/></td>
        <td>${reg.baseId.idcard}</td>
        <td>${reg.organization.fullName}</td>
        <td>${reg.duty.dutyName}</td>
        <td>${reg.grade.gradeName}</td>
        <td>${reg.baseId.census}</td>
        <td>${reg.baseId.archives}</td>
        </tr>
    </s:iterator>
    </tbody>
</table>
<p>
    <%@ include file="/WEB-INF/pages/common/main_orgtab_pager.jsp" %>
</p>

<script type="text/javascript">
    var selectName="";
    function selectStaff(obj) {
        selectName=obj.value;
    }

    function toUrl(){
        if(selectName==""){
            alert('请先选择一个员工');
            return;
        }
        var strs=selectName.split("_");
        var url='#employee/staff_add.xhtml?id='+strs[0]+'&name='+strs[1];
        window.location.href=encodeURI(url);
    }
</script>